# **Project DIVA Arcade Future Tone HID Keyboard**

## Description:

This project is to help to build your own PDAFT arcade box. It is built on AVR micro controller and will represent itself as a HID keyboard. 

It can connect 9 buttons and these 9 buttons are mapped as per PD-Loader key settings. (Triangle, Square, Cross, Circle, Start, Left Slider Left, Left Slider Right, Right Slider Left, Right Slider Right) You can also build a slider bar using MPR121 touch module and connect to I2C port. The slider bar will work along with slider buttons.

It support multiple key hold which is required by PDAFT. The project is based on HID 1.11 and support maximum 6 key hold at the same time.

If you need to build with slider bar support, you will need to download MPR121 library. MPR121 is using the standard Adafruit_MPR121 library. Please download it from Arduino library manager or Adafruit website. I have not included in this repository.

## Hardware preparation: 

MikuButton Project (Simulate slider bar with button click)
* AVR micro controller * 1 (ATMEGA8, 168, 328p etc. Any micro controller with 4K+ flash would be OK)
* 16M Crystal          * 1
* 104 Capacitor        * 1
* 22P Capacitor        * 2
* 68R Resistor         * 2
* 1.5K Resistor        * 1
* 3.6V Zener Diode     * 2
* USB Male Plug        * 1

MikuButtonSlider Project (MikuButton Project with Slider Bar support)
* AVR micro controller       * 1 (ATMEGA8, 168, 328p etc. Any micro controller with 8K+ flash would be OK)
* 16M Crystal                * 1
* 104 Capacitor              * 1
* 22P Capacitor              * 2
* 68R Resistor               * 2
* 1.5K Resistor              * 1
* 3.6V Zener Diode           * 2
* USB Male Plug              * 1
* MPR121 Touch Sensor Module * 2
* Copper Foil Tape

## Software preparation:

[Arduino IDE](https://www.arduino.cc/en/main/software)

## How to wire up:

![Schematic](https://notabug.org/zsccat/PDAFT-HID-Keyboard/src/master/MikuButton.PNG)

## Pin mapping:

MikuButton Project
* Triangle -> 13
* Square   -> 12
* Cross    -> 11
* Circle   -> 10
* Start    -> 9
* LSL      -> A3
* LSR      -> A2
* RSL      -> A1
* RSR      -> A0

MikuButtonSlider Project
* Triangle       -> 13
* Square         -> 12
* Cross          -> 11
* Circle         -> 10
* Start          -> 9
* LSL            -> A3
* LSR            -> A2
* RSL            -> A1
* RSR            -> A0
* MPR121 x 2 SDA -> A4
* MPR121 x 2 SCL -> A5

## How to use:

1. Put UsbKeyboardMiku into your Arduino library.
2. Load MikuButton project using Arduino IDE.
3. Select your target chip
4. Upload

## Testing board

![Testing board](https://notabug.org/zsccat/PDAFT-HID-Keyboard/src/master/TestingBoard.jpg)